<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template adaptive_pool</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.adaptive__pool_8hpp" title="Header &lt;boost/container/adaptive_pool.hpp&gt;">
<link rel="prev" href="../../boost_container_header_reference.html" title="Boost.Container Header Reference">
<link rel="next" href="structboost_1_1container_1_1adaptive__pool_1_1rebind.html" title="Struct template rebind">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../../boost_container_header_reference.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.adaptive__pool_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1container_1_1adaptive__pool_1_1rebind.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template adaptive_pool</span></h2>
<p>boost::container::adaptive_pool</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.adaptive__pool_8hpp" title="Header &lt;boost/container/adaptive_pool.hpp&gt;">boost/container/adaptive_pool.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> NodesPerBlock <span class="special">=</span> <span class="identifier">ADP_nodes_per_block</span><span class="special">,</span> 
         <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> MaxFreeBlocks <span class="special">=</span> <span class="identifier">ADP_max_free_blocks</span><span class="special">,</span> 
         <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> OverheadPercent <span class="special">=</span> <span class="identifier">ADP_overhead_percent</span> <span class="identifier">BOOST_CONTAINER_DOCIGN</span><span class="special">(</span> <span class="identifier">BOOST_MOVE_I</span> <span class="keyword">unsigned</span> <span class="identifier">Version</span> <span class="special">)</span><span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pooltypes">types</a></span>
  <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">int</span>                                                                                                   <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a549defdc59d9966f30ae7111014c5148"><span class="identifier">allocation_type</span></a><span class="special">;</span>
  <span class="keyword">typedef</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a><span class="special">&lt;</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span><span class="special">,</span> <span class="identifier">MaxFreeBlocks</span><span class="special">,</span> <span class="identifier">OverheadPercent</span> <span class="identifier">BOOST_CONTAINER_DOCIGN</span><span class="special">(</span><span class="identifier">BOOST_MOVE_I</span> <span class="identifier">Version</span><span class="special">)</span> <span class="special">&gt;</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1af4045be36d99114c5f200df8d06e3d37"></a><span class="identifier">self_t</span><span class="special">;</span>         
  <span class="keyword">typedef</span> <span class="identifier">T</span>                                                                                                              <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a5fe05e92bd44ba4d39392ff5eb8c0232"></a><span class="identifier">value_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="identifier">T</span> <span class="special">*</span>                                                                                                            <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a4ba3bbf26fbdfae83df80b45d931757e"></a><span class="identifier">pointer</span><span class="special">;</span>        
  <span class="keyword">typedef</span> <span class="keyword">const</span> <span class="identifier">T</span> <span class="special">*</span>                                                                                                      <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1ae1378352f8ba1c7524e1ad4c86241ad3"></a><span class="identifier">const_pointer</span><span class="special">;</span>  
  <span class="keyword">typedef</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">::</span><span class="identifier">dtl</span><span class="special">::</span><span class="identifier">unvoid_ref</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span>                                                                 <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a7ed916f5e89e85414f684d25f9128a5f"></a><span class="identifier">reference</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">::</span><span class="identifier">dtl</span><span class="special">::</span><span class="identifier">unvoid_ref</span><span class="special">&lt;</span> <span class="identifier">constT</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span>                                                            <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a874df56629fb71e7d46144b8661f9096"></a><span class="identifier">const_reference</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span>                                                                                                    <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a27795b77f08b06b5ad099fb6be432dd4"></a><span class="identifier">size_type</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ptrdiff_t</span>                                                                                                 <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1ad74343253904eff7a34a3d1be799a442"></a><span class="identifier">difference_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">::</span><span class="identifier">dtl</span><span class="special">::</span><span class="identifier">version_type</span><span class="special">&lt;</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1af4045be36d99114c5f200df8d06e3d37">self_t</a><span class="special">,</span> <span class="identifier">Version</span> <span class="special">&gt;</span>                                                         <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a02d15bae219c0bebbe14f4b5f28f5752"></a><span class="identifier">version</span><span class="special">;</span>        

  <span class="comment">// member classes/structs/unions</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
  <span class="keyword">struct</span> <a class="link" href="structboost_1_1container_1_1adaptive__pool_1_1rebind.html" title="Struct template rebind">rebind</a> <span class="special">{</span>
    <span class="comment">// types</span>
    <span class="keyword">typedef</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span><span class="special">,</span> <span class="identifier">MaxFreeBlocks</span><span class="special">,</span> <span class="identifier">OverheadPercent</span> <span class="identifier">BOOST_CONTAINER_DOCIGN</span><span class="special">(</span><span class="identifier">BOOST_MOVE_I</span> <span class="identifier">Version</span><span class="special">)</span> <span class="special">&gt;</span> <a class="link" href="structboost_1_1container_1_1adaptive__pool_1_1rebind.html#doxygen.boost_container_header_reference.structboost_1_1container_1_1adaptive__pool_1_1rebind_1a2ed325eed42575cb88dbf05a8a241c07"><span class="identifier">other</span></a><span class="special">;</span>
  <span class="special">}</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="../reference_section_of_boost_any/classboost_1_1any.html#id1-bb">public member functions</a></span>
   <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a0c4864b05ed1d3e3c9690ac601d07b45"><span class="identifier">BOOST_CONTAINER_DOCIGN</span></a><span class="special">(</span><span class="identifier">BOOST_CONTAINER_STATIC_ASSERT</span><span class="special">(</span><span class="special">(</span><span class="identifier">Version</span><span class="special">&lt;=</span><span class="number">2</span><span class="special">)</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1ab0ebaf668426d7bc8250977a35bfb0aa"><span class="identifier">adaptive_pool</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1ae77e18ed2a11d52d7795530451ef657a"><span class="identifier">adaptive_pool</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a536e3caa5a534aae6cebd7bb9d9cc27a"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
    <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1aec72f680f3b25783fc61465424b2e20a"><span class="identifier">adaptive_pool</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span><span class="special">,</span> <span class="identifier">MaxFreeBlocks</span><span class="special">,</span> <span class="identifier">OverheadPercent</span> <span class="identifier">BOOST_CONTAINER_DOCIGN</span><span class="special">(</span><span class="identifier">BOOST_MOVE_I</span> <span class="identifier">Version</span><span class="special">)</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a4c8ef0b3912d08f91807e61f83a765fd"><span class="special">~</span><span class="identifier">adaptive_pool</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">size_type</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a47fbcdc605028f66828832570f886d4a"><span class="identifier">max_size</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a90fb280e366602b6f4aee55b11fb5e3b"><span class="identifier">allocate</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">void</span> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a96331f65410a1eec1b85a60cecfe4f01"><span class="identifier">deallocate</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a616f6b58d7181e8c50cc4fc504d3bc23"><span class="identifier">allocation_command</span></a><span class="special">(</span><span class="identifier">allocation_type</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">size_type</span> <span class="special">&amp;</span><span class="special">,</span> 
                             <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">size_type</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a1ef51c9897e74410cd34a3bf19e0e1a9"><span class="identifier">size</span></a><span class="special">(</span><span class="identifier">pointer</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a23f7504aaf08fbb99a5694d4fa726c32"><span class="identifier">allocate_one</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1ae35f00c6ff2ed6268e2f2362941460e7"><span class="identifier">allocate_individual</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a9daf3ad62680326937b5b7df482fae41"><span class="identifier">deallocate_one</span></a><span class="special">(</span><span class="identifier">pointer</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1add81114fe5b031d714133c712be6925f"><span class="identifier">deallocate_individual</span></a><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a859d305e02e46e2a3deb9e48ea1e1639"><span class="identifier">allocate_many</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1ac34a1599e22c86ce2640b4b92c6b2070"><span class="identifier">allocate_many</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span> <span class="special">*</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a1b7a318c58da1f938f69c1550fed6a90"><span class="identifier">deallocate_many</span></a><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="../reference_section_of_boost_any/classboost_1_1bad__any__cast.html#id2-bb">public static functions</a></span>
  <span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a2b52533887462639599ec591cf891ffe"><span class="identifier">deallocate_free_blocks</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="../reference_section_of_boost_any/classboost_1_1anys_1_1basic__any.html#id3-bb">friend functions</a></span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a814db8be3a7f6be74bda35e1b4e91334"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a17e49bd0bdb3c3fbc6b2a69123494d97"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a0d3c0229258c41615a4007d8048b5e74"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="../reference_section_of_boost_any/classboost_1_1anys_1_1unique__any.html#id4-bb">private member functions</a></span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1ab0b943ffdc6634bcad5b57ef4e94d1ef"><span class="identifier">priv_allocation_command</span></a><span class="special">(</span><span class="identifier">allocation_type</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">size_type</span> <span class="special">&amp;</span><span class="special">,</span> 
                                  <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// public data members</span>
  <span class="identifier">BOOST_STATIC_CONSTEXPR</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">nodes_per_block</span><span class="special">;</span>
  <span class="identifier">BOOST_STATIC_CONSTEXPR</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">max_free_blocks</span><span class="special">;</span>
  <span class="identifier">BOOST_STATIC_CONSTEXPR</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">overhead_percent</span><span class="special">;</span>
  <span class="identifier">BOOST_STATIC_CONSTEXPR</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">real_nodes_per_block</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.8.14.2.3.4"></a><h2>Description</h2>
<p>An STL node allocator that uses a modified DLMalloc as memory source.</p>
<p>This node allocator shares a segregated storage between all instances of <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> with equal sizeof(T).</p>
<p>NodesPerBlock is the number of nodes allocated at once when the allocator needs runs out of nodes. MaxFreeBlocks is the maximum number of totally free blocks that the adaptive node pool will hold. The rest of the totally free blocks will be deallocated to the memory manager.</p>
<p>OverheadPercent is the (approximated) maximum size overhead (1-20%) of the allocator: (memory usable for nodes / total memory allocated from the memory allocator) </p>
<div class="refsect2">
<a name="id-1.3.8.14.2.3.4.6"></a><h3>
<a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pooltypes"></a><code class="computeroutput">adaptive_pool</code> 
        public
       types</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<p>
<span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">int</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a549defdc59d9966f30ae7111014c5148"></a><span class="identifier">allocation_type</span><span class="special">;</span></p>
<p>If Version is 1, the allocator is a STL conforming allocator. If Version is 2, the allocator offers advanced expand in place and burst allocation capabilities. </p>
</li></ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.8.14.2.3.4.7"></a><h3>
<a name="id1-bb"></a><code class="computeroutput">adaptive_pool</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a0c4864b05ed1d3e3c9690ac601d07b45"></a><span class="identifier">BOOST_CONTAINER_DOCIGN</span><span class="special">(</span><span class="identifier">BOOST_CONTAINER_STATIC_ASSERT</span><span class="special">(</span><span class="special">(</span><span class="identifier">Version</span><span class="special">&lt;=</span><span class="number">2</span><span class="special">)</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1ab0ebaf668426d7bc8250977a35bfb0aa"></a><span class="identifier">adaptive_pool</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Default constructor. </li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1ae77e18ed2a11d52d7795530451ef657a"></a><span class="identifier">adaptive_pool</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Copy constructor from other <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a>. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a536e3caa5a534aae6cebd7bb9d9cc27a"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Copy assignment from other <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a>. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
  <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1aec72f680f3b25783fc61465424b2e20a"></a><span class="identifier">adaptive_pool</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span><span class="special">,</span> <span class="identifier">MaxFreeBlocks</span><span class="special">,</span> <span class="identifier">OverheadPercent</span> <span class="identifier">BOOST_CONTAINER_DOCIGN</span><span class="special">(</span><span class="identifier">BOOST_MOVE_I</span> <span class="identifier">Version</span><span class="special">)</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Copy constructor from related <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a>. </li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a4c8ef0b3912d08f91807e61f83a765fd"></a><span class="special">~</span><span class="identifier">adaptive_pool</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Destructor. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a47fbcdc605028f66828832570f886d4a"></a><span class="identifier">max_size</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Returns the number of elements that could be allocated. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a90fb280e366602b6f4aee55b11fb5e3b"></a><span class="identifier">allocate</span><span class="special">(</span><span class="identifier">size_type</span> count<span class="special">,</span> <span class="keyword">const</span> <span class="keyword">void</span> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>
<p>Allocate memory for an array of count elements. Throws bad_alloc if there is no enough memory </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a96331f65410a1eec1b85a60cecfe4f01"></a><span class="identifier">deallocate</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">,</span> <span class="identifier">size_type</span> count<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Deallocate allocated memory. Never throws </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a616f6b58d7181e8c50cc4fc504d3bc23"></a><span class="identifier">allocation_command</span><span class="special">(</span><span class="identifier">allocation_type</span> command<span class="special">,</span> <span class="identifier">size_type</span> limit_size<span class="special">,</span> 
                           <span class="identifier">size_type</span> <span class="special">&amp;</span> prefer_in_recvd_out_size<span class="special">,</span> 
                           <span class="identifier">pointer</span> <span class="special">&amp;</span> reuse<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a1ef51c9897e74410cd34a3bf19e0e1a9"></a><span class="identifier">size</span><span class="special">(</span><span class="identifier">pointer</span> p<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Returns maximum the number of objects the previously allocated memory pointed by p can hold. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a23f7504aaf08fbb99a5694d4fa726c32"></a><span class="identifier">allocate_one</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Allocates just one object. Memory allocated with this function must be deallocated only with <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a9daf3ad62680326937b5b7df482fae41">deallocate_one()</a>. Throws bad_alloc if there is no enough memory </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1ae35f00c6ff2ed6268e2f2362941460e7"></a><span class="identifier">allocate_individual</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> num_elements<span class="special">,</span> 
                         <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size == 1. Elements must be individually deallocated with <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a9daf3ad62680326937b5b7df482fae41">deallocate_one()</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a9daf3ad62680326937b5b7df482fae41"></a><span class="identifier">deallocate_one</span><span class="special">(</span><span class="identifier">pointer</span> p<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Deallocates memory previously allocated with <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a23f7504aaf08fbb99a5694d4fa726c32">allocate_one()</a>. You should never use deallocate_one to deallocate memory allocated with other functions different from <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a23f7504aaf08fbb99a5694d4fa726c32">allocate_one()</a>. Never throws </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1add81114fe5b031d714133c712be6925f"></a><span class="identifier">deallocate_individual</span><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a859d305e02e46e2a3deb9e48ea1e1639"></a><span class="identifier">allocate_many</span><span class="special">(</span><span class="identifier">size_type</span> elem_size<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> n_elements<span class="special">,</span> 
                   <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size elem_size. Elements must be individually deallocated with <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a96331f65410a1eec1b85a60cecfe4f01">deallocate()</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1ac34a1599e22c86ce2640b4b92c6b2070"></a><span class="identifier">allocate_many</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span> <span class="special">*</span> elem_sizes<span class="special">,</span> <span class="identifier">size_type</span> n_elements<span class="special">,</span> 
                   <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates n_elements elements, each one of size elem_sizes[i] Elements must be individually deallocated with <a class="link" href="classboost_1_1container_1_1adaptive__pool.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a96331f65410a1eec1b85a60cecfe4f01">deallocate()</a> </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a1b7a318c58da1f938f69c1550fed6a90"></a><span class="identifier">deallocate_many</span><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.8.14.2.3.4.8"></a><h3>
<a name="id2-bb"></a><code class="computeroutput">adaptive_pool</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a2b52533887462639599ec591cf891ffe"></a><span class="identifier">deallocate_free_blocks</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Deallocates all free blocks of the pool. </li></ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.8.14.2.3.4.9"></a><h3>
<a name="id3-bb"></a><code class="computeroutput">adaptive_pool</code> friend functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a814db8be3a7f6be74bda35e1b4e91334"></a><span class="identifier">swap</span><span class="special">(</span><a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">,</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Swaps allocators. Does not throw. If each allocator is placed in a different memory segment, the result is undefined. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a17e49bd0bdb3c3fbc6b2a69123494d97"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>An allocator always compares to true, as memory allocated with one instance can be deallocated by another instance </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1a0d3c0229258c41615a4007d8048b5e74"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1adaptive__pool.html" title="Class template adaptive_pool">adaptive_pool</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>An allocator always compares to false, as memory allocated with one instance can be deallocated by another instance </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.8.14.2.3.4.10"></a><h3>
<a name="id4-bb"></a><code class="computeroutput">adaptive_pool</code> private member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1adaptive__pool_1ab0b943ffdc6634bcad5b57ef4e94d1ef"></a><span class="identifier">priv_allocation_command</span><span class="special">(</span><span class="identifier">allocation_type</span> command<span class="special">,</span> 
                                <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> limit_size<span class="special">,</span> 
                                <span class="identifier">size_type</span> <span class="special">&amp;</span> prefer_in_recvd_out_size<span class="special">,</span> 
                                <span class="identifier">pointer</span> <span class="special">&amp;</span> reuse_ptr<span class="special">)</span><span class="special">;</span></pre></li></ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2009-2018 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../../boost_container_header_reference.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.adaptive__pool_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1container_1_1adaptive__pool_1_1rebind.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
